﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Users/Users.Master" AutoEventWireup="true"
    CodeBehind="EditContact.aspx.cs" Inherits="Pantry.Web.Users.EditContactForm" %>

<%@ Register TagPrefix="CC1" Namespace="SiteUtils" Assembly="CollectionPager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="Resources/css/hainhh1.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="UpdatePanelEditContact" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="CollectionPager1" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonBack" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonClose" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSave" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSearch" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSelect" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonLookup" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="CheckBoxIncludeInactive" EventName="CheckedChanged" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSortByName" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSortByMobile" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSortByEmail" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSortByType" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ButtonSortByStatus" EventName="Click" />
        </Triggers>
        <ContentTemplate>
            <div id="create_contact" class="g_12">
                <div class="widget_header">
                    <h4 class="widget_header_title wwIcon i_16_forms">
                        Edit Contact
                    </h4>
                </div>
                <div id="input_form" class="widget_contents noPadding">
                    <div id="left_column">
                        <div id="line_1" class="grid_line">
                            <div class="block_label label">
                                FirstName: <span class="must">*</span>
                            </div>
                            <div class="block_input">
                                <asp:TextBox runat="server" CssClass="simple_field" ID="TextBoxFirstName" />
                                <asp:RequiredFieldValidator ID="Validator1" runat="server" ControlToValidate="TextBoxFirstName"
                                    ValidationGroup="submit" ErrorMessage="You must fill this field." CssClass="validation_class"
                                    Visible="True" />
                            </div>
                        </div>
                        <div id="line_2" class="grid_line">
                            <div class="block_label">
                                SurName: <span class="must">*</span>
                            </div>
                            <div class="block_input">
                                <asp:TextBox runat="server" ID="TextBoxSurname" CssClass="simple_field" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBoxSurname"
                                    ValidationGroup="submit" ErrorMessage="You must fill this field." CssClass="validation_class"
                                    Visible="True" />
                            </div>
                        </div>
                        <div id="line_3" class="grid_line">
                            <div class="block_label">
                                Known As:
                            </div>
                            <div class="block_input">
                                <asp:TextBox runat="server" ID="TextBoxKnownAs" CssClass="simple_field" />
                            </div>
                        </div>
                        <div id="line_4" class="grid_line">
                            <div class="block_label">
                                Office Phone:
                            </div>
                            <div class="block_input">
                                <asp:TextBox runat="server" CssClass="simple_field" ID="TextBoxOfficePhone" />
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="TextBoxOfficePhone"
                                    ErrorMessage="Invalid phone number" ValidationExpression="[0-9]+" CssClass="validation_class" />
                            </div>
                        </div>
                        <div id="line_5" class="grid_line">
                            <div class="block_label">
                                Mobile Phone:
                            </div>
                            <div class="block_input">
                                <asp:TextBox ID="TextBoxMobilePhone" runat="server" CssClass="simple_field" />
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBoxMobilePhone"
                                    ErrorMessage="Invalid phone number" ValidationExpression="[0-9]+" CssClass="validation_class" />
                            </div>
                        </div>
                        <div id="line_6" class="grid_line">
                            <div class="block_label">
                                ST Home Phone:
                            </div>
                            <div class="block_input">
                                <asp:TextBox runat="server" ID="TextBoxHomePhone" CssClass="simple_field" />
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="TextBoxHomePhone"
                                    ErrorMessage="Invalid phone number" ValidationExpression="[0-9]+" CssClass="validation_class" />
                            </div>
                        </div>
                        <div id="line_7" class="grid_line">
                            <div class="block_label">
                                Email Address:
                            </div>
                            <div class="block_input">
                                <asp:TextBox runat="server" ID="TextBoxEmail" CssClass="simple_field" />
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="TextBoxEmail"
                                    ErrorMessage="Enter email invalid" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                    CssClass="validation_class" />
                            </div>
                        </div>
                    </div>
                    <div id="right_column" class="column">
                        <div id="line_8" class="grid_line">
                            <div class="block_label">
                                Manager Name:
                            </div>
                            <div class="block_input">
                                <asp:TextBox runat="server" ID="TextBoxManagerName" CssClass="simple_field manager_text_length"
                                    ReadOnly="True" />
                                <asp:HiddenField ID="HiddenManagerId" runat="server" />
                                <asp:LinkButton runat="server" ID="ButtonLookup" CssClass="label" Text="Lookup" OnClick="ButtonLookupClick" />
                            </div>
                        </div>
                        <div id="line_9" class="grid_line">
                            <div class="block_label">
                                Contact Type:<span class="must"></span>
                            </div>
                            <div class="block_input">
                                <asp:DropDownList ID="ListContactType" runat="server" CssClass="selector">
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div id="line_10" class="grid_line">
                            <div class="block_label">
                                Best Contact Method:
                            </div>
                            <div class="block_input">
                                <asp:DropDownList runat="server" ID="ListContactMethod" CssClass="selector">
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div id="line_11" class="grid_line">
                            <div class="block_label">
                                JobRole:
                            </div>
                            <div class="block_input">
                                <asp:TextBox runat="server" ID="TextBoxJobRole" CssClass="simple_field" />
                            </div>
                        </div>
                        <div id="line_12" class="grid_line">
                            <div class="block_label">
                                Workbase:
                            </div>
                            <div class="block_input">
                                <asp:TextBox runat="server" ID="TextBoxWorkBase" CssClass="simple_field" />
                            </div>
                        </div>
                        <div id="line_13" class="grid_line">
                            <div class="block_label">
                                JobTitle:
                            </div>
                            <div class="block_input">
                                <asp:TextBox runat="server" ID="TextBoxJobTitle" CssClass="simple_field"></asp:TextBox>
                            </div>
                        </div>
                        <div id="line_14" class="grid_line">
                            <div class="block_label">
                                Is Active?
                            </div>
                            <div class="block_input">
                                <asp:CheckBox runat="server" ID="CheckBoxIsActive" CssClass="simple_form" />
                            </div>
                        </div>
                    </div>
                </div>
                <div id="control_button" class="dtBottom">
                    <div class="dtInfo">
                        <asp:Label ID="UpdateLabel" runat="server"></asp:Label>
                    </div>
                    <div class="dtPagination">
                        <asp:Button runat="server" ID="ButtonSave" Text="Save" CssClass="simple_buttons my_button"
                            OnClick="ButtonSaveClick" ValidationGroup="submit" />
                        <asp:Button runat="server" ID="ButtonBack" Text="Back" CssClass="simple_buttons my_button"
                            OnClick="ButtonBackClick" />
                    </div>
                </div>
            </div>
            <!--Update Panel-->
            <asp:Panel ID="PanelPopup" Visible="false" runat="server" CssClass="">
                <div class="popup">
                    <div id="list_contact" class="g_12">
                        <div class="widget_header wwOptions">
                            <h4 class="widget_header_title wwIcon i_16_data">
                                List Contacts</h4>
                        </div>
                        <div class="widget_contents noPadding">
                            <div class="dataTables_wrapper">
                                <div class="dtTop">
                                    <div class="dtFilter">
                                        <div class="dataTables_filter">
                                            <div style="float: left;">
                                                First Name:
                                                <asp:TextBox ID="TextBoxFirstNameSearch" runat="server" CssClass="simple_field" Width="100px" />
                                            </div>
                                            <div style="float: left;">
                                                Surname:
                                                <asp:TextBox ID="TextBoxSurnameSearch" runat="server" CssClass="simple_field" Width="100px" />
                                            </div>
                                            <div style="float: left; padding: 16px 0 0 10px;">
                                                <asp:Button ID="ButtonSearch" runat="server" CssClass="simple_buttons" Text="Search Contact" OnClick="ButtonSearchClick" />
                                            </div>
                                            <div style="float: left;">
                                                <asp:CheckBox ID="CheckBoxIncludeInactive" runat="server" CssClass="simple_form my_checkbox"
                                                    Text="Include in-active" AutoPostBack="true" OnCheckedChanged="CheckBoxIncludeActiveCheckedChanged" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="dtTables">
                                    <table id="DataTables_Table_0" class="tables  noObOLine dataTable" aria-describedby="DataTables_Table_0_info">
                                        <thead>
                                            <tr id="head_table">
                                                <th>
                                                </th>
                                                <th class="sorting">
                                                    <asp:LinkButton ID="ButtonSortByName" runat="server" Text="Contact Name" OnClick="ButtonSortByNameClick" />
                                                </th>
                                                <th class="sorting">
                                                    <asp:LinkButton ID="ButtonSortByMobile" runat="server" Text="Mobile Phone" OnClick="ButtonSortByMobileClick" />
                                                </th>
                                                <th class="sorting">
                                                    <asp:LinkButton ID="ButtonSortByEmail" runat="server" Text="Email" OnClick="ButtonSortByEmailClick" />
                                                </th>
                                                <th class="sorting">
                                                    <asp:LinkButton ID="ButtonSortByType" runat="server" Text="Contact Type" OnClick="ButtonSortByContactTypeClick" />
                                                </th>
                                                <th class="sorting">
                                                    <asp:LinkButton ID="ButtonSortByStatus" runat="server" Text="Status" OnClick="ButtonSortByStatusClick" />
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <asp:Repeater ID="RepeaterContact" runat="server">
                                                <ItemTemplate>
                                                    <tr>
                                                        <td>
                                                            <input type="radio" id="radio" name="RadioContactId" value='<%#Eval("ContactId")%>$<%#Eval("FullName")%>'
                                                                class="simple_form" />
                                                        </td>
                                                        <td id="td">
                                                            <%#Eval("FullName")%>
                                                        </td>
                                                        <td>
                                                            <%#Eval("MobilePhone")%>
                                                        </td>
                                                        <td>
                                                            <%#Eval("Email")%>
                                                        </td>
                                                        <td>
                                                            <%#Eval("ContactType") %>
                                                        </td>
                                                        <td>
                                                            <%#Eval("IsActive") %>
                                                        </td>
                                                    </tr>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="dtBottom">
                                    <div class="dtInfo">
                                        <div id="control_buttons1">
                                            <asp:Button ID="ButtonSelect" runat="server" Text="Select" CssClass="simple_buttons my_button"
                                                OnClick="ButtonSelectClick" />
                                            <asp:Button ID="ButtonClose" runat="server" Text="Close" CssClass="simple_buttons my_button"
                                                OnClick="ButtonCloseClick" />
                                        </div>
                                    </div>
                                    <div class="dtPagination">
                                        <cc1:collectionpager id="CollectionPager1" runat="server" backtext="Back" firsttext="First"
                                            showlabel="True" showfirstlast="False" nexttext="Next" resultslocation="None"
                                            pagenumbersseparator=" " hideonsinglepage="False" pagingmode="PostBack">
                                        </cc1:collectionpager>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>

    <script type="text/javascript">
        $(document).ready(function() {
            $('ul.tab_nav li').removeClass("active_tab");
            $('ul.tab_nav li.i_32_tables').addClass("active_tab");
        });
    </script>

</asp:Content>
